<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    textarea{height: 500px;}
  </style>
</head>
<body>
  <textarea class="txt1"></textarea>
  <input type="button" class="btn" value="转换">
  <textarea class="txt2"></textarea>
</body>
<script>

  var txt1 = document.querySelector(".txt1")
  var txt2 = document.querySelector(".txt2")
  var btn = document.querySelector(".btn")

  btn.onclick = function(){
    var str = txt1.value;
    // 替换html标签的正则
    var reg = /<[^>]+>/ig;
    txt2.value = str.replace(reg, "");
  }
</script>
</html>



